<template>
  <div class="child">
    <h2>我是child组件</h2>
    <h2>当前求和为：{{ sum }}</h2>
  </div>
</template>

<script setup lang="ts" name="Child">
import axios from "axios";
import { ref } from "vue";

let sum = ref(0);

// 存在异步任务 await需要写在async函数中，setup自带async函数
let {data: { content },} = await axios.get("https://api.uomg.com/api/rand.qinghua?format=json");
console.log(content);
</script>

<style>
.child {
  background-color: skyblue;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 0 10px;
}
</style>
